//字段名称
/**
 * 病人数据库字段：
 * id:唯一标识
 * name:姓名
 * age：年龄
 * gender：性别
 * address：家庭住址
 * signDate：签约日期
 * signDoctorId：签约医生/团队Id
 * recordId：电子病历Id
 * physicalExam: 体检报告Id
 */
import moment from "moment";

const columns = [
    {
        dataIndex: 'name',
        key: 'name',
        //customTitle代表slot
        slots: {title: 'customTitle'},
        scopedSlots: {customRender: 'name'},
    },
    {
        title: '联系方式',
        dataIndex: 'phone',
        key: 'phone'
    },
    {
        title: '电子邮箱',
        dataIndex: 'email',
        key: 'email'
    },
    {
        title: '年龄',
        dataIndex: 'age',
        key: 'age',
        //按照年龄排序
        sorter: (a, b) => a.age - b.age
    },
    {
        title: '地址',
        dataIndex: 'address',
        key: 'address',
    },
    {
        title: '性别',
        key: 'gender',
        dataIndex: 'gender',
        scopedSlots: {customRender: 'gender'},
    },
    {
        title: '签约日期',
        dataIndex: 'signDate',
        key: 'signDate',
        //日期格式化
        customRender: (text) => {
            return moment(text).format('YYYY-MM-DD')
        }
    },
    {
        title: 'Action',
        key: 'action',
        scopedSlots: {customRender: 'action'},
    },


];

export default columns;

